<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <link rel="stylesheet" th:href="@{/statics/css/common.css}" type="text/css">
</head>
<body>
<header>
    <a th:href="@{/to/userReg}">注册</a>
    <span th:if="${session.user == null}"><a th:href="@{/to/userLogin}">登录</a></span>
    <span th:text="${session.user != null ? '欢迎'+session.user.name : '请登录'}">游客</span>
    <span th:if="${session.user != null}"><a th:href="@{/to/existLogin}">退出登录</a></span>
</header>
    <h1>新闻列表</h1>
    <ul th:each="news : ${newsList}">
        <li><a th:href="@{'/checkNews/'+${news.id}}" th:text="${news.title}">这是新闻</a></li>
    </ul>
<footer></footer>
</body>
</html>